﻿namespace myLog
{
    using MediaPortal.ServiceImplementations;
  using MediaPortal.Configuration;

    using System;
    using System.IO;

    internal class logger
    {
        private static StreamWriter writer = File.AppendText(Config.GetFolder(Config.Dir.Log) + @"\mVids.log");

        public static void log(string line)
        {
            try
            {
                writer.WriteLine("[" + DateTime.Now.TimeOfDay.ToString() + "] - " + line);
                writer.Flush();
            }
            catch (Exception exception)
            {
                Log.Error("Music Video DB - Error writing to mVids.log file." + Environment.NewLine + exception.ToString(), new object[0]);
                Log.Info("Music Video DB - entry attempted to be written to mVids.log:" + Environment.NewLine + line, new object[0]);
            }
        }
    }
}

